import { http } from '@/package_saleman/utils/request.js'

enum Urls {
	goodsCartList = 'salesman/search/category',
	goodsList = 'salesman/goods_stock',
  warehouseGoodsList = 'mini/search/warehouse_goods',
	orderAdd = 'salesman/order/add',
	cartAdd = 'salesman/order/cart',
	cartNewEdit = 'salesman/order/cart_edit',
	cartEdit = 'mini/cart/edit',
	cartList = 'salesman/order/cart_list',
	cartDel = 'salesman/order/cart_del',
	orderSettle = 'mini/order/settle',
	returnList = 'mini/goods/return_list',
	returnAdd = 'mini/order/return_add',
	carAddPay = 'salesman/order/sign'
}

// 商品分类
export const goodsCartListApi = () => http.get(Urls.goodsCartList)

// 商品列表
export const goodsList = (params) => http.get(Urls.goodsList, params)

// 车销商品列表
export const warehouseGoodsList = (params) => http.get(Urls.goodsList, params)

// 退货商品列表
export const returnList = (params) => http.get(Urls.returnList, params)

// 新增订单
export const orderAdd = (data) => http.post(Urls.orderAdd, data)
// 车销提交
export const carAddPay = (data) => http.post(Urls.carAddPay, data)
// 商品修改
export const cartEdit = (data) => http.post(Urls.cartEdit, data)
// 购物车修改
export const cartNewEdit = (data) => http.post(Urls.cartNewEdit, data)
// 退货新增订单
export const returnAdd = (data) => http.post(Urls.orderAdd, data)

// 购物车新增
export const cartAdd = (data) => http.post(Urls.cartAdd, data)

// 购物车列表
export const cartList = (params) => http.get(Urls.cartList, params)

// 删除购物车
export const cartDel = (data) => http.post(Urls.cartDel, data)

// 结算获取数据
export const orderSettle = (params) => http.get(Urls.orderSettle, params)